<?php

include '../php-ofc-library/open-flash-chart.php';

$d = array();
$d[] = new pie_value(120, "Income");
$d[] = new pie_value(99, "Spend");
$d[] = new pie_value(21, "Profit");

$pie = new pie();
$pie->set_animate( true );
//$pie->add_animation( new pie_fade() );
$pie->set_label_colour( '#432BAF' );
$pie->set_alpha( 0.75 );
//
// This is where we turn of the labels,
// but we use them inside the tooltip:
//
$pie->set_tooltip( '#label#<br>$#val# (#percent#)' );
$pie->set_no_labels();
//
//
//
$pie->set_colours(
    array(
        '#77CC6D',    // income (green)
        '#FF5973',    // spend (pink)
        '#6D86CC'    // profit (blue)
    ) );

$pie->set_values( $d );

$chart = new open_flash_chart();
$chart->add_element( $pie );

echo $chart->toPrettyString();
?>
